import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Demo {
    public static void main(String[] args) throws InterruptedException {
        Object locker = new Object();
        synchronized (locker){
            System.out.println("等待前");
            locker.wait();
            System.out.println("等待后");
        }
    }
}
/*class Solution {
    public List<List<Integer>> queensAttacktheKing(int[][] queens, int[] king) {
        Set<Integer> set = new HashSet<>();
        for(int[] x : queens){
            int i = x[0], j = x[1];
            set.add(i*8+j);
        }
        List<List<Integer>> ans = new ArrayList<>();
        for(int dx=-1; dx<=1; dx++){
            for(int dy=-1; dy<=1; dy++){
                if(dx==0 && dy==0)
                    continue;
                int kx = king[0] + dx, ky = king[1] + dy;
                while(kx >= 0 && kx < 8 && ky >= 0 && ky < 8){
                    int pos = kx * 8 + ky;
                    if(set.contains(pos)){
                        ans.add(new ArrayList<>(List.of(kx,ky)));
                        break;
                    }
                    kx += dx;
                    ky += dy;
                }
            }
        }
        return ans;
    }
}*/
